#ifndef _STRTOX_H
#define _STRTOX_H

#include <types.h>

int strtoull(const char *s, unsigned int base, unsigned long long *res);
int strtoll(const char *s, unsigned int base, long long *res);
int strtoul(const char *s, unsigned int base, unsigned long *res);
int strtol(const char *s, unsigned int base, long *res);
int strtouint(const char *s, unsigned int base, unsigned int *res);
int strtoint(const char *s, unsigned int base, int *res);

static inline int strtou64(const char *s, unsigned int base, u64 *res)
{
    return strtoull(s, base, res);
}

static inline int strtos64(const char *s, unsigned int base, s64 *res)
{
    return strtoll(s, base, res);
}

static inline int strtou32(const char *s, unsigned int base, u32 *res)
{
    return strtouint(s, base, res);
}

static inline int strtos32(const char *s, unsigned int base, s32 *res)
{
    return strtoint(s, base, res);
}

int strtou16(const char *s, unsigned int base, u16 *res);
int strtos16(const char *s, unsigned int base, s16 *res);
int strtou8(const char *s, unsigned int base, u8 *res);
int strtos8(const char *s, unsigned int base, s8 *res);

#endif /* _STRTOX_H */
